package com.sos.core.game.client.events
{
	import com.sos.core.game.client.GameClient;
	
	import flash.events.Event;
	
	public class GameClientEvent extends Event
	{
		
		// -------------------------------------------------------------------------------
		// CONSTANTS
		// -------------------------------------------------------------------------------
		
		// Events
		public static const         EVENT_CONNECT:String				= "gameClientConnect";
		public static const         EVENT_DISCONNECT:String				= "gameClientDisconnect";
		public static const         EVENT_CONNECTION_LOST:String		= "gameClientConnectionLost";
		public static const         EVENT_CONNECTION_FAILED:String		= "gameClientConnectionFailed";
		public static const         EVENT_REQUEST_EXECUTED:String		= "gameClientRequestExecuted";
		public static const         EVENT_REQUEST_FAILED:String			= "gameClientRequestFailed";
		public static const         EVENT_REQUEST_WAITING:String		= "gameClientRequestWaiting";
		public static const         EVENT_ERROR:String					= "gameClientError";
		
		// -------------------------------------------------------------------------------
		// FIELDS
		// -------------------------------------------------------------------------------
		
		private var _client:GameClient;
		
		// -------------------------------------------------------------------------------
		// CONSTRUCTOR
		// -------------------------------------------------------------------------------
		
		/**
		 * Create a generic GameClient event
		 * @param t Event type name
		 * @param c CLient that dispatch the event
		 */		
		public function GameClientEvent(t:String, c:GameClient)
		{
			super(t);
			// Init
			_client = c;
		}
		
		// -------------------------------------------------------------------------------
		// PROPERTIES
		// -------------------------------------------------------------------------------

		public function get client():GameClient
		{
			return _client;
		}

	}
}